package cn.zhf.shop.service.impl;

import cn.zhf.shop.entity.AccountDeal;
import cn.zhf.shop.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import cn.zhf.shop.entity.Audit;
import java.util.List;
import cn.zhf.shop.mapper.AuditMapper;
import cn.zhf.shop.service.AuditService;

@Service
public class AuditServiceImpl implements AuditService {

    @Resource
    private AuditMapper auditMapper;

    @Override
    public Message deleteByPrimaryKey(Integer auditId) {
        return auditMapper.deleteByPrimaryKey(auditId) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insertSelective(Audit record) {
        return auditMapper.insertSelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer auditId) {
        return Message.success(null).add(auditMapper.selectByPrimaryKey(auditId));
    }

    @Override
    public Message updateByPrimaryKeySelective(Audit record) {
        return auditMapper.updateByPrimaryKeySelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }


    @Override
    public Message selectAll() {
        return Message.success(null).add(auditMapper.selectAll());
    }

    @Override
    public int batchInsertSelective(List<Audit> list) {
        return auditMapper.batchInsertSelective(list);
    }

    @Override
    public int insert(Audit record) {
        return auditMapper.insert(record);
    }

    @Override
    public int updateByPrimaryKey(Audit record) {
        return auditMapper.updateByPrimaryKey(record);
    }

    @Override
    public Message<List<Audit>> selectAllByAuditAuditTitleId(String id) {
        return Message.success(null).add(auditMapper.selectAllByAuditAuditTitleId(id));
    }

    @Override
    public Message<List<Audit>> selectByMerorderno(String id) {
        return Message.success(null).add(auditMapper.selectByMerorderno(id));
    }
}


